package com.zero.zutils
{
	import flash.display.Shape;

	public class ShapeUtils
	{
		/**
		 * 画长方形方法 
		 * @param $tempShape
		 * @param $x
		 * @param $y
		 * @param $backColor
		 * @param $width
		 * @param $height
		 * @param $borderColor
		 * @param $borderSize
		 * @param $alpha
		 * @return 
		 * 
		 */		
		public static function drawRect($tempShape:Shape, $backColor:uint, $width:int, $height:int, $borderColor:uint=0, $x:int=0, $y:int=0, $borderSize:int=1, $alpha:Number=1):Shape
		{
			if(!$tempShape)
			{
				$tempShape = new Shape();
			}
			$tempShape.graphics.beginFill($backColor, $alpha);
			if($borderColor)
			{
				$tempShape.graphics.lineStyle($borderSize,$borderColor);
			}
			$tempShape.graphics.drawRect($x, $y, $width, $height);
			$tempShape.graphics.endFill();
			return $tempShape;
		}
	}
}